package com.haidechizi.backup.tree;

/**
 * @author: wangdejun
 * @create: 2020-03-14 11:44
 **/
public class TestBinaryTree {

    public static void main(String[] args) {
        Node root = new Node(1);

        BinaryTree binaryTree = new BinaryTree(root);

        Node node2 = new Node(2);
        Node node3 = new Node(3);
        Node node4 = new Node(4);
        Node node5 = new Node(5);
        Node node6 = new Node(6);
        Node node7 = new Node(7);


        root.setLeft(node3);
        root.setRight(node5);
        node3.setLeft(node2);
        node3.setRight(node4);

        node5.setLeft(node6);
        node5.setRight(node7);

        Node node = binaryTree.searchNode(7);
//        System.out.println(node);
        binaryTree.frontPrint();

        System.out.println("=============");

        binaryTree.deepShow();

        System.out.println("===========");
//        binaryTree.midPrint();
        System.out.println("===========");
//        binaryTree.afterPrint();

        binaryTree.delete(5);

        binaryTree.frontPrint();


    }
}
